<?php

use yii\db\Migration;

/**
 * Class m190313_074833_wx_cardmsg
 */
class m190313_074833_wx_cardmsg extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
        $this->createTable('wx_cardmsg', [
            'id'       => $this->primaryKey()->notNull()->unsigned()->comment('卡券消息主键id'),
            'touser'   => $this->string(32)->notNull()->defaultValue('')->comment('消息接收者openid'),
            'card_id'  => $this->string(64)->notNull()->defaultValue('')->comment('卡券card_id'),
            'send_time'=> $this->bigInteger(10)->notNull()->defaultValue(0)->comment('消息发送时间')
        ], $tableOptions);
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m190313_074833_wx_cardmsg cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m190313_074833_wx_cardmsg cannot be reverted.\n";

        return false;
    }
    */
}
